package exercise.jslide.jslide.view.components;

import javafx.geometry.Insets;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;

// 状态栏实现
public class StatusBar extends HBox {
    private Label slideNumberLabel;
    private Label zoomLabel;

    public StatusBar() {
        setPadding(new Insets(5));
        setSpacing(10);

        slideNumberLabel = new Label("幻灯片 1 / 1");
        zoomLabel = new Label("缩放: 100%");

        getChildren().addAll(slideNumberLabel, zoomLabel);
    }

    public void updateSlideNumber(int current, int total) {
        slideNumberLabel.setText(String.format("幻灯片 %d / %d", current, total));
    }

    public void updateZoom(int zoomPercent) {
        zoomLabel.setText(String.format("缩放: %d%%", zoomPercent));
    }
}